package com.cskaoyan.mapper;

import com.cskaoyan.bean.entity.Cart;
import com.cskaoyan.bean.entity.OrderGoods;
import com.cskaoyan.bean.entity.OrderGoodsExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface OrderGoodsMapper {
    long countByExample(OrderGoodsExample example);

    int deleteByExample(OrderGoodsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(OrderGoods record);

    int insertSelective(OrderGoods record);

    List<OrderGoods> selectByExample(OrderGoodsExample example);

    OrderGoods selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") OrderGoods record, @Param("example") OrderGoodsExample example);

    int updateByExample(@Param("record") OrderGoods record, @Param("example") OrderGoodsExample example);

    int updateByPrimaryKeySelective(OrderGoods record);

    int updateByPrimaryKey(OrderGoods record);


    // 修改market_order_goods表中的商品评论
    void updateCommentByOrderGoodsId(@Param("commentId") Integer id, @Param("orderGoodsId") Integer orderGoodsId);

    List<OrderGoods> selectOrderGoodsListByOrderId(Integer orderId);

    void updateOrderGoodsDeleted(@Param("orderId") Integer orderId);

    OrderGoods selectOrderGoodsBean(@Param("orderId") Integer orderId, @Param("goodsId") Integer goodsId);

    List<Integer> selectBetween(@Param("start") Date start, @Param("end") Date end);

    void insertOrderGoods(@Param("orderId") Integer orderId, @Param("cart") Cart cart2);
}